package com.ruoyi.business.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.ruoyi.business.domain.AccommodationFee;
import com.ruoyi.business.mapper.AccommodationFeeMapper;
import com.ruoyi.business.service.IAccommodationFeeService;

import java.util.List;
import java.util.Map;
import java.util.Collection;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * 宿舍缴费历史Service业务层处理
 *
 * @author songzhengsheng
 * @date 2023-09-22
 */
@RequiredArgsConstructor
@Service
public class AccommodationFeeServiceImpl  extends ServiceImpl<AccommodationFeeMapper, AccommodationFee> implements IAccommodationFeeService {


    @Override
    public LambdaQueryWrapper<AccommodationFee> buildQueryWrapper(AccommodationFee bo) {
        LambdaQueryWrapper<AccommodationFee> lqw = Wrappers.lambdaQuery();
                    lqw.eq(bo.getEmployeeId() != null, AccommodationFee::getEmployeeId, bo.getEmployeeId());
                    lqw.eq(bo.getRoomId() != null, AccommodationFee::getRoomId, bo.getRoomId());
                    lqw.eq(bo.getFeeDate() != null, AccommodationFee::getFeeDate, bo.getFeeDate());
                    lqw.eq(bo.getFeeAmount() != null, AccommodationFee::getFeeAmount, bo.getFeeAmount());
                    lqw.eq(bo.getAirConditioningFee() != null, AccommodationFee::getAirConditioningFee, bo.getAirConditioningFee());
                    lqw.eq(StringUtils.isNotBlank(bo.getLevel()), AccommodationFee::getLevel, bo.getLevel());
                    lqw.eq(bo.getRent() != null, AccommodationFee::getRent, bo.getRent());
        return lqw;
    }

}
